package com.mioto.ld.result;

/**
 * @author mioto-qinxj
 * @date 2024/4/11
 * @desc 接口返回状态/描述枚举
 */
public enum SystemTip {

    OK("10000", "success"),
    INSERT_FAIL("10001", "新增失败"),
    UPDATE_FAIL("10002", "更新失败"),
    DELETE_FAIL("10003", "删除失败"),
    PARAM_VALID_FAIL("10004", "参数验证失败"),
    SYSTEM_ERROR("10005", "系统错误"),
    DUPLICATE_KEY_ERROR("10006", "违反数据库字段唯一约束"),
    //认证
    UNAUTHORIZED("11001", "未授权"),
    NOT_LOGGED_IN("11002", "未登录"),
    LOGIN_FAILURE("11003", "登录失败"),
    USERNAME_PASSWORD_ERROR("11004", "用户名或密码错误"),
    USER_LOCKED("11005", "用户被冻结"),

    USER_FORBID_LOGIN("11006", "app用户禁止登录"),
    USER_DISABLED("11007", "用户被禁用"),
    USER_OLD_PWD_MISMATCH("11008", "原始密码错误"),
    CLIENT_TYPE_ERROR("11009", "clientType传参错误"),
    USERNAME_EXIST("11010", "用户名已存在"),
    //token验证
    TOKEN_EXPIRED("13000","token过期"),
    TOKEN_VERIFY("13001","token校验失败"),

    //文件上传下载
    FILE_NOT_EXIST("12000","文件不存在"),
    FILE_UPLOAD_FAIL("12001","文件上传失败");

    private String code;
    private String desc;

    SystemTip(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String code() {
        return this.code;
    }

    public String desc() {
        return this.desc;
    }
}
